package com.test;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;


public class ConnectionPool {
	
	public static void main(String[] args) {
		
		try {
			Class cla = (Class<ConnectionPool>) Class.forName("com.test.Fuck");
			Method methods[] = cla.getDeclaredMethods();
			Object obj = cla.newInstance();
			
			for (Method method : methods) {
				method.setAccessible(true);
				System.out.println(method.getName());
				if(method.getName().endsWith("fuck") && method.getParameterTypes().length==0){
						method.invoke(obj, null);
				}
			}
		} catch (ClassNotFoundException e) { 
			e.printStackTrace();
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		} 
		catch (Exception e) {
			e.printStackTrace();
		} 
		
	}
	
	private void getString(String str){
		System.out.println(str);
	}
	private String getString(){
		System.out.println("getString");
		return "String";
	}
}
class Fuck{
	private void fuck(){
		
	}
}